<%@page import="databank.DataBankVo"%>
<%@page import="databank.DataBank"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>view.jsp</title>
<style>
#view_body{
width: 700px;
margin:0 auto;
border:2px dotted #5CD1E5;
background-color: #EAEAEA;
}
#upload_title{
width: 100%;
text-align: center;
margin: 0 auto;
margin-top:10p;
margin-bottom:10px;
margin-left:20px;
padding-top:30px;
padding-bottom:30px;

}
#upload_serial, #upload_mid, #upload_subject, #upload_content, #upload_mdate, #upload_filename{
width: 90%;
margin-top:10p;
margin-bottom:10px;
margin-left:20px;
background-color: white;
padding: 10px;
}

#upload_serial{

}
#upload_mid{

}
#upload_subject{

}
#upload_content{

}
#upload_mdate{}

}
#upload_filename{

}
.button_design{
width: 80px;
height: 30px;
border:2px dotted pink;
border-radius: 10px;
}
</style>

<script>
function btn_list(){
	location.href="index2.jsp?inc_center=./databank/list.jsp";
}

function btn_del(serial, filename){
	var f = confirm("정말 삭제하시겠습니까?");
	if(f){
		location.href="index2.jsp?inc_center=./databank/delete_result.jsp&serial=" + serial + "&filename=" + filename;
	
	} else { 
		alert("취~소 되었다!!!!");
	}
}

function btn_modify(serial){
	location.href="index2.jsp?inc_center=./databank/modify.jsp&serial=" + serial;
}

function fileDownload(filename){
	url = "./databank/filedownload.jsp?filename=" + filename;
	wind = window.open(url, "win", "");
}
</script>
</head>
<body>
<jsp:useBean id="bankVo" class="databank.DataBankVo"/>
<jsp:setProperty property="*" name="bankVo"/>
<%
DataBank bank = new DataBank();
bank.setVo(bankVo);
DataBankVo v = bank.view();
String url = "./upload/" + v.getFilename();
%>

<div id="view_body">
	<form name="filecheck" action="modify.jsp" method="post" enctype="multipart/form-data">

		<div id="upload_title"><h1>파일 업로드</h1></div>
		<div id="upload_mid">올린사람 : <%=v.getMid() %></div>
		<div id="upload_serial">serial : <%=v.getSerial() %></div>
		<div id="upload_mid">올린사람 : <%=v.getMid() %></div>
		<div id="upload_subject">제&emsp;&emsp;목 : <%=v.getSubject()%></div>
		<div id="upload_content">내&emsp;&emsp;용 : <%=v.getContent()%></div>
		<div id="upload_mdate">작성일 : <%=v.getMdate()%></div>
		<div id="upload_filename">첨부파일 :<a href="#" onclick="fileDownload('<%=v.getFilename()%>')"> <%=v.getFilename()%></a></div>
		
		<br/>
		<center>
		<input type="button" value="수정" class="button_design" onclick="btn_modify(<%=v.getSerial()%>)">
		<input type="button" value="삭제" class="button_design" onclick="btn_del('<%=v.getSerial()%>', '<%=v.getFilename()%>')">
		<input type="button" value="목록" class="button_design" id="upload_button" onclick="btn_list()">
		</center>
		<br/><br/>
	</form>
</div>

</body>
</html>